package com.wang.lottery.domain.award.service.factory;

import com.wang.lottery.common.Constants;
import com.wang.lottery.domain.award.service.goods.IDistributionGoods;
import com.wang.lottery.domain.award.service.goods.impl.CouponGoods;
import com.wang.lottery.domain.award.service.goods.impl.DescGoods;
import com.wang.lottery.domain.award.service.goods.impl.PhysicalGoods;
import com.wang.lottery.domain.award.service.goods.impl.RedeemCodeGoods;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author wjh
 * @create 2023-11-03 18:46
 * 各类发奖奖品配置类
 */
public class GoodsConfig {
    @Resource
    private CouponGoods couponGoods;
    @Resource
    private DescGoods descGoods;
    @Resource
    private PhysicalGoods physicalGoods;
    @Resource
    private RedeemCodeGoods redeemCodeGoods;
    /** 奖品发放策略组 */
    protected Map<Integer, IDistributionGoods> iDistributionGoodsMap = new ConcurrentHashMap<>();
    
    @PostConstruct
    public void init() {
        iDistributionGoodsMap.put(Constants.AwardType.CouponGoods.getCode(), couponGoods);
        iDistributionGoodsMap.put(Constants.AwardType.DESC.getCode(),descGoods);
        iDistributionGoodsMap.put(Constants.AwardType.PhysicalGoods.getCode(), physicalGoods);
        iDistributionGoodsMap.put(Constants.AwardType.RedeemCodeGoods.getCode(), redeemCodeGoods);
    }
}
